Skip to content

test(mcpx): poll the upgrade-reap pid file until the pid lands (dezren39/nix#442) - #332

Merged
dezren39 merged 1 commit into
mainfrom
creator/442-upgrade-pid-poll
Oct 19, 2026
Merged

dezren39 merged 1 commit into
mainfrom
creator/442-upgrade-pid-poll

Conversation

@dezren39

@dezren39 dezren39 commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Mirror port of dezren39/nix PR #443 for the cross-repo set tracked by dezren39/darwin-nix#442 — this repo's pkgs/mcpx copy of upgrade_test.go was byte-identical to the nix copy except the #435 reference comment, and carries the same defect: TestUpgradeSuccessorThatDoesNotDialBackIsReaped's pid-file poll breaks on the first successful read and parses once, so a pid file created before its pid lands fails the test with strconv.Atoi: parsing "": invalid syntax and the reaping assertion never runs.

Test-only change, identical to the nix half: poll until the content parses as a pid or the 5s deadline passes; on deadline, fail naming the pid file.

Verified this run:

  • Target test with the unmodified successor script: PASS -count=3.
  • Delayed-write construction (scratch only: pid file created empty, pid lands ~5s later): PASS with the fix (6.02s) — the same construction fails pre-fix in the nix copy with the exact error from the origin issue.
  • Full internal/daemon suite green (79.2s); gofmt clean; post-fix file differs from the nix copy only in the pre-existing dezren39/nix#435 comment.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Tests
    • Improved the reliability of upgrade process testing by allowing time for a valid successor process identifier to become available.

…n39/darwin-nix#442)

Mirror of the dezren39/nix fix for the identical copy: the poll
broke on the first successful ReadFile and parsed the content
once, outside the loop, so a pid file that existed before its pid
landed failed the test with a bare strconv.Atoi error instead of
waiting. Poll until the content parses; on the deadline, fail
naming the pid file.
@dezren39
dezren39 requested a review from a team as a code owner October 19, 2026 02:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T02:57:33.549038Z a2c85e5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cf6fb315-5e59-45ca-986d-9f93769f1a4a
📥 Commits

Reviewing files that changed from the base of the PR and between 6b41442 and a2c85e5.

📒 Files selected for processing: 1
  • pkgs/mcpx/internal/daemon/upgrade_test.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

📝 Walkthrough

The successor upgrade test now polls its PID file until it reads a parseable integer or the five-second timeout expires.

Changes: Successor PID-file polling

Layer / File(s) Summary
Wait for a parseable PID
pkgs/mcpx/internal/daemon/upgrade_test.go
The test continues polling when the PID file is missing or its contents are empty or invalid. If no parseable PID appears within five seconds, it reports a PID-write timeout.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to a2c85

The test now waits for the successor PID to be written before checking the successor. No material merge-blocking risk is evident.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: polling the upgrade-reap PID file until the PID is available. The test scope is specific and the issue reference is relevant.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@dezren39
dezren39 merged commit 9cc54fd into main Oct 19, 2026
17 checks passed
@dezren39
dezren39 deleted the creator/442-upgrade-pid-poll branch October 19, 2026 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant